<template>
  <div class="dashboard-editor-container">
    <panel-group />

    <el-row style="background: #fff; padding: 8px 16px 0; margin-bottom: 32px">
      <div class="title">
        <h2 style="text-align: center">用户分析</h2>
        <el-radio-group v-model="type" size="small" class="title-btn">
          <el-radio-button label="1">月</el-radio-button>
          <el-radio-button label="0">日</el-radio-button>
          <!-- <el-radio-button label="2">时</el-radio-button> -->
        </el-radio-group>
      </div>

      <line-chart :type="type" />
    </el-row>

    <el-row :gutter="32">
      <el-col :xs="24" :sm="24" :lg="12">
        <div class="chart-wrapper">
          <h2 style="text-align: center">供应类型占比</h2>
          <pie-chart type="1" />
        </div>
      </el-col>
      <el-col :xs="24" :sm="24" :lg="12">
        <div class="chart-wrapper">
          <h2 style="text-align: center">供需对比</h2>
          <pie-chart type="2" />
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import PanelGroup from "./dashboard/PanelGroup";
import LineChart from "./dashboard/LineChart";
import RaddarChart from "./dashboard/RaddarChart";
import PieChart from "./dashboard/PieChart";
import BarChart from "./dashboard/BarChart";

export default {
  name: "Index",
  components: {
    PanelGroup,
    LineChart,
    RaddarChart,
    PieChart,
    BarChart,
  },
  data() {
    return {
      type: "1",
    };
  },
};
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

.title {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  &-btn {
    position: absolute;
    right: 0;
  }
}

@media (max-width: 1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}
</style>
